<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .card {
      width: 200px;
      height: 200px;
      perspective: 100vw;
      position: relative;
    }

    .face {
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      width: 100%;
      background-color: red;
      transition: 0.5s;
      backface-visibility: hidden;
    }

    .back {
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      width: 100%;
      background-color: aqua;
      transform: rotateY(180deg);
      backface-visibility: hidden;
      transition: all 0.5s;
    }

    .card:hover .back {
      transform: rotateY(0);
    }

    .card:hover .face {
      transform: rotateY(-180deg);
    }
  </style>
</head>

<body>
  <div class="card">
    <div class="face">正面</div>
    <div class="back">背景</div>
  </div>

</body>

</html>